package com.example.drugs1.services;

import com.example.drugs1.dao.RoomRepository;
import com.example.drugs1.entities.Room;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoomService {

    @Autowired
    RoomRepository roomRepository;

    public Room save(Room room){return roomRepository.save(room);}

    public List<Room> getALL(){return roomRepository.findAll();}

    public Room findByRoomId(long theId){

        return roomRepository.findByRoomId(theId);
    }
    public void delete(Room theRoom){
        roomRepository.delete(theRoom);
    }

    public List<Room> selectRoom(String theName){
        return roomRepository.selectRoom(theName);
    }
}
